<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>行为编辑</title>
<link href="__UI__/css/bs3/dpl-min.css" rel="stylesheet" type="text/css" />
<link href="__UI__/css/bs3/bui-min.css" rel="stylesheet" type="text/css" />
<link href="__CHECK__/css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
button {
	margin-right:20px;
}
</style>
</head>
<body>
<div class="demo-content" style="margin-top:1%;">
	<hr/> 	
    <div class="row" style="margin-left:10px;">
        <form id="J_Form" action="{:U('Action/edit')}" class="form-horizontal registerform" method="post" enctype="multipart/form-data">
        	<div id="tab" style="margin-left:1%; padding-bottom:20px;"></div>
            <div id="panel" class="" style="padding:10px;">
                <input name="id" type="hidden" value="{$info.id}" >
                <input name="update_time" type="hidden" value="{$Think.const.NOW_TIME}" >
                <div class="control-group ">
 					<label class="control-label"><s>*</s>行为标识</label>
					<div class="controls">
						<input name="name" type="text" class="input-large" value="{$info.name}">
					</div>
				</div>
                <div class="control-group">
					<label class="control-label"><s>*</s>行为名称</label>
					<div class="controls">
						<input name="title" type="text" class="input-large" value="{$info.title}">
					</div>
				</div>
                <div class="row">
                	<div class="control-group span9">
						<label class="control-label"><s></s>日志模块</label>
						<div class="controls bui-form-field-select" data-items="{'Admin':'后台','Home':'系统'}">
							<input name="module" type="hidden" value="{$info.module}">
						</div>
					</div>
					<div class="control-group span9">
						<label class="control-label"><s></s>行为类型</label>
						<div class="controls bui-form-field-select" data-items="{'1':'系统','2':'用户'}">
							<input name="type" type="hidden" value="{$info.type}">
						</div>
					</div>
					<div class="control-group span9">
						<label class="control-label"><s></s>行为状态</label>
						<div class="controls bui-form-field-select" data-items="{'0':'禁用','1':'开启'}">
							<input name="status" type="hidden" value="{$info.status}">
						</div>
					</div>
                </div>
				<div class="control-group" style="margin-bottom:80px;">
					<label class="control-label"><s></s>日志规则</label>
					<div class="controls">
						<textarea name="log" style="width:530px; height:80px">{$info.log}</textarea>
					</div>
				</div>
				<div class="row actions-bar">
                	<span id="msgdemo2"></span>
                    <div class="form-actions span9 offset3">
                        <button type="submit" class="button button-primary">保存</button>
                        <button type="reset" class="button">重置</button>
                        <button type="button" class="button button-info" name="backid" id="backid">返回</button>
                    </div>
            	</div>           
            </div>
        </form>
    </div>
</div>
<script type="text/javascript" src="__UI__/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="__UI__/js/bui-min.js"></script>
<script type="text/javascript" src="__UI__/js/config-min.js"></script>
<script type="text/javascript">
	$(function () {       
		$('#backid').click(function(){
			top.topManager.openPage({
				id:'action_{$module}',
				title:'行为管理',
				href:'{:U("Action/index",array("module"=>$module))}',
				isClose:true,
			});
		 });
    });
	top.topManager.closePage('action_{$module}');
	top.topManager.closePage('action_{$module}_add');
    BUI.use(['bui/tab','bui/mask'],function(Tab){
        var tab = new Tab.TabPanel({
            render:'#tab',
            elCls:'nav-tabs',
            panelContainer:'#panel',
            autoRender:true,
            children:[
                {title:'基本信息',value:'1',selected:true},
            ]
        });
    });
    BUI.use('bui/form', function (Form){
        new Form.Form({
            srcNode:'#J_Form'
        }).render();
    });
</script>
<script type="text/javascript" src="__CHECK__/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
	$(function(){
		$(".registerform").Validform({
			tiptype:function(msg,o,cssctl){
				var objtip=$("#msgdemo2");
				cssctl(objtip,o.type);
				objtip.text(msg);
			},
			ajaxPost:true,
			callback:function(data){
				if(data.status == 'y'){
					top.topManager.openPage({
						id:'action_{$module}',
						title:'行为管理',
						href:'{:U("Action/index",array("module"=>$module))}',
						isClose:true,
					});
				}
			},
		});
	})
</script>
</body>
</html>